﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master" CodeBehind="Cliente.aspx.cs" Inherits="CROSLAND.WebApp.Cliente" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphHeader" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphTopMenu" runat="server">

</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="cphTopContent" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphMain" runat="server">
    <%--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">--%>

<%--<html xmlns="http://www.w3.org/1999/xhtml">--%>
<%--<head id="Head1" runat="server">
    <title>Clientes</title>
    <link href="css/master.css" rel="stylesheet" type="text/css" />
</head>
<body>--%>
    <%--<form id="form1" runat="server">--%>
    <div>
        <asp:Panel ID="PanelBusquedaCliente" runat="server">
            <div><h3>Búsqueda de Clientes</h3></div>
            <div>
                <div style="float:left;">
                    <asp:Button ID="btnNuevoCliente" runat="server" Text="Nuevo" 
                        onclick="btnNuevoCliente_Click" />
                </div>
                <div style="float:left;">
                    &nbsp;&nbsp;
                </div>
                <div style="float:none; display:none;">
                    <asp:Button ID="btnModificarCliente" runat="server" Text="Modificar" 
                        onclick="btnModificarCliente_Click" />
                </div>
            </div>
            <div>
                <div style="float:left;">
                    <div style="float:left;">Código/NIF:</div> 
                    <div style="float:none;"><asp:TextBox ID="txtNIFCliente" runat="server" CssClass="inputbox"></asp:TextBox></div>
                </div>
                <div style="float:left;">
                    <div style="float:left;">Nombre: </div>
                    <div style="float:none;"><asp:TextBox ID="txtNombreCliente" runat="server" CssClass="inputbox"></asp:TextBox></div>
                </div>
                <div style="float:left;">
                    &nbsp;&nbsp;
                </div>
                <div>
                    <asp:Button ID="btnBuscarCliente" runat="server" Text="Buscar" 
                        onclick="btnBuscarCliente_Click" />
                </div>
            </div>
            <div>
                <asp:GridView ID="gvCliente" runat="server" AutoGenerateColumns="false"
                    GridLines="Vertical" DataKeyNames="Codigo" CssClass="tbl-materiales" 
                    AllowPaging="True" onpageindexchanging="gvCliente_PageIndexChanging" 
                    onrowcommand="gvCliente_RowCommand" Font-Size="X-Small">
                    <Columns>
                        <asp:TemplateField HeaderText="Seleccionar" HeaderStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:ImageButton ID="imgSeleccion" runat="server" CommandName="Select" ImageUrl="~/img/select.gif" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Codigo" HeaderText="Código" HeaderStyle-Width="80px" ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="nif" HeaderText="NIF" HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Center" />
                        <%--<asp:BoundField DataField="NOMBRE" HeaderText="Nombre" HeaderStyle-Width="250px" ItemStyle-HorizontalAlign="Left" />--%>
                        <asp:TemplateField HeaderText="Nombre">
                            <ItemTemplate>
                                <%# Eval("NOMBRE") %> <%# Eval("APPAT")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>             
                        
                          <asp:ImageButton ID="btnModelo" runat="server" ImageUrl="~/img/flujo.png" />

                         
                          <asp:Panel ID="pnlModelo" runat="server" ScrollBars="Auto" Width="750px" CssClass="modalPopup" style="display:none">
                               <asp:Panel ID="pnlMoveModelo" runat="server" Width="100%" BackColor="lightblue" BorderColor="#6289AE" HorizontalAlign="Center">
                                        Bancos
                               </asp:Panel>   
                               <div style="clear:both"></div>   
                               <br /> 
                                 <asp:GridView ID="gvModelo" runat="server" CssClass="tbl-stock" Width="100%" EmptyDataText="No hay datos registrados" 
                                        AutoGenerateColumns="false" DataSource = '<%# Bind("ListaBanco") %>'>
                                             <Columns>
                                                    <asp:BoundField DataField="banco" HeaderText="Banco" ItemStyle-HorizontalAlign="Center" />
                                                    <asp:BoundField DataField="txtBanco" HeaderText="Nombre Banco" />
                                                    <asp:BoundField DataField="credipago" HeaderText="Credipago" ItemStyle-HorizontalAlign="Center" />
                                             </Columns>
                                        </asp:GridView>      
           
                               <div style="width:100%; text-align:right; padding-top:5px;">
                                   <asp:ImageButton ID="btnOkModelo" runat="server" ImageUrl="~/img/ok16.png" ImageAlign="Middle"   />
                               </div>

                               <div style="clear:both"></div>    
                           </asp:Panel>
                           <cc1:ModalPopupExtender ID="mpeModelo" runat="server" TargetControlID="btnModelo" 
                                PopupControlID="pnlModelo"  BackgroundCssClass="modalBackground" 
                                PopupDragHandleControlID="pnlMoveModelo" CancelControlID="btnOkModelo" >
                            </cc1:ModalPopupExtender>          
                        
                                    
                      </ItemTemplate>
                  </asp:TemplateField> 
                    </Columns>
                </asp:GridView>
            </div>
        </asp:Panel>
        <asp:Panel ID="PanelCreacionCliente" runat="server">
            <div><h3>
                    <asp:Label ID="LabelModo" runat="server" Text=""></asp:Label>
                </h3>
            </div>
            <div>
                <div id="contenedorprincipal">
                    <div id="divCodigo" runat="server" style="float:none;width:300px">
                        <div style="float:left;">Código:</div>
                        <div style="float:none; text-align: right;">
                            <asp:TextBox ID="txtCodCliente" runat="server" CssClass="inputbox" ReadOnly="true"></asp:TextBox>
                        </div>
                    </div>
                    <div>
                        <div style="float:left;width:400px;">
                            <div style="float:left;">Nombres:</div>
                            <div style="float:none; text-align: right;">
                                <asp:TextBox ID="txtNombres" runat="server" Width="250px" CssClass="inputbox"></asp:TextBox>
                            </div>
                        </div>
                        <div style="float:none;width:400px;">
                            <div style="float:left;">Apellidos:</div>
                            <div style="float:none; text-align: right;"> 
                                <asp:TextBox ID="txtApellidos" runat="server" Width="250px" CssClass="inputbox"></asp:TextBox>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div style="float:left;width:450px;">
                            <div style="float:left;">Calle y N°: </div>
                            <div style="float:none; text-align: right;"> 
                                <asp:TextBox ID="txtDireccion" runat="server" Width="300px" CssClass="inputbox"></asp:TextBox>
                            </div>
                        </div>
                        <div style="float:none;width:300px;">
                            <div style="float:left;">Región: </div>
                            <div style="float:none; text-align: right;">
                                <asp:DropDownList ID="ddlRegion" runat="server" CssClass="inputbox" Width="155px"
                                    onselectedindexchanged="ddlRegion_SelectedIndexChanged" AutoPostBack="True">
                                </asp:DropDownList>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div style="float:left;width:300px;">
                            <div style="float:left;">Población: </div>
                            <div style="float:none; text-align: right;"> 
                                <asp:DropDownList ID="ddlPoblacion" runat="server" CssClass="inputbox" Width="155px"
                                    AutoPostBack="True" onselectedindexchanged="ddlPoblacion_SelectedIndexChanged">
                                </asp:DropDownList>
                            </div>
                        </div>                        
                        <div style="float:none;width:300px;">
                            <div style="float:left;">Distrito: </div>
                            <div style="float:none; text-align: right;"> 
                                <asp:DropDownList ID="ddlDistrito" runat="server" CssClass="inputbox" Width="155px">
                                </asp:DropDownList>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div style="float:left;width:300px;">
                            <div style="float:left;">Teléfono: </div>
                            <div style="float:none; text-align: right;">
                                <asp:TextBox ID="txtTelefono" runat="server" CssClass="inputbox"></asp:TextBox>
                            </div>
                        </div>
                        <div style="float:none;width:300px;">
                            <div style="float:left;">Email: </div>
                            <div style="float:none; text-align: right;">
                                <asp:TextBox ID="txtEmail" runat="server" CssClass="inputbox"></asp:TextBox>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div style="float:left;width:300px;">
                            <div style="float:left;">Tipo NIF:</div>
                            <div style="float:none; text-align: right;">
                                <asp:DropDownList ID="ddlNIF" runat="server" CssClass="inputbox">
                                    <asp:ListItem Value="01">Doc. Nac. de  Identidad (DNI)</asp:ListItem>
                                    <asp:ListItem Value="04">Carnet de Extranjería</asp:ListItem>
                                    <asp:ListItem Value="06">Reg. Único de Contribuy. (RUC)</asp:ListItem>
                                    <asp:ListItem Value="07">Pasaporte</asp:ListItem>
                                </asp:DropDownList> 
                            </div>
                        </div>
                        <div style="float:none;width:300px;">
                            <div style="float:left;">NIF: </div>
                            <div style="float:none; text-align: right;">
                                <asp:TextBox ID="txtNIF" runat="server" CssClass="inputbox"></asp:TextBox>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div style="float:left;width:300px;">
                            <div style="float:left;">Zona Registral: </div>
                            <div style="float:none; text-align: right;">
                                <asp:DropDownList ID="ddlZonaRegistral" runat="server"  Width="155px" CssClass="inputbox">
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div style="float:none;width:300px;">
                            <div style="float:left;">Grupo Clientes Veh.: </div>
                            <div style="float:none; text-align: right;">
                                <asp:DropDownList ID="ddlGrupoClientes" runat="server"  Width="155px" CssClass="inputbox">
                                </asp:DropDownList>
                            </div>
                        </div>
                    </div>                
                    <div style="width:300px;">
                        <div style="float:left;">Moneda: </div>
                        <div style="float:none; text-align: right;">
                            <asp:DropDownList ID="ddlMoneda" runat="server"  Width="155px" CssClass="inputbox">
                                <asp:ListItem>PEN</asp:ListItem>
                                <asp:ListItem>USD</asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </div>
                </div>
                <div>
                    <asp:Label ID="lblResult" runat="server" Text=""></asp:Label>
                </div>
                <div id="contenedorsecundario">
                    <div style="float:left">
                        <asp:Button ID="btGuardar" runat="server" Text="Guardar" 
                            onclick="btGuardar_Click" />
                    </div>
                    <div style="float:left">&nbsp;&nbsp;</div>
                    <div style="float:left">
                        <%--<asp:Button ID="btnLimpiar" runat="server" Text="Limpiar" />--%>
                    </div>
                    <div style="float:left">&nbsp;&nbsp;</div>
                    <div style="float:none">
                        <asp:Button ID="btnSalir" runat="server" Text="Salir" 
                            onclick="btnSalir_Click" />
                    </div>
                </div>
            </div>
        </asp:Panel>
    </div>
    <%--</form>--%>
<%--</body>--%>
<%--</html>--%>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cphFooter" runat="server">
</asp:Content>
